#define THIS_FILE "conquerir.sqf"
#include <base\tmf_constants.h>
#include <base\tmf_macros.h>
WAITINIT(conquerir);

// ["Land_HelipadEmpty_F","marker_conquer"] execVM "conquerir.sqf";
if (!isServer) exitWith {};
private ["_type","_marker","_error","_obj_params","_obj_params","_conquered","_conquered_msg"];
DEFAULT_PARAM(_type,0,"");
DEFAULT_PARAM(_marker,1,"");
DEFAULT_PARAM(_conquered,2,"");
DEFAULT_PARAM(_conquered_msg,3,["STR_TYR_TARGET_CONQUERED"]);

_error = false;
if (IS_STRING(_type)) then { _error = (_type == "") };
if (IS_STRING(_marker)) then { _error = (_marker == "") };
if (_error) exitWith {};

_obj_params = [];
_obj_params set [TMF_VEH_PARAMS_TYPE, _type];
_obj_params set [TMF_VEH_PARAMS_POS, _marker];

_tmf_params = [];
_tmf_params = [_tmf_params,"CONQUER_MSG",_conquered_msg] call CFUNC(hashSet);
_tmf_params = [_tmf_params,"CONQUER_ZONE",_marker] call CFUNC(hashSet);
// _tmf_params = [_tmf_params,"CONQUER_OWNER",[GVAR(side_enemy)]] call CFUNC(hashSet);
_tmf_params = [_tmf_params,"SHARED_VAR",_conquered] call CFUNC(hashSet);
_tmf_params = [_tmf_params,"CONQUER_LEFT",-1] call CFUNC(hashSet);
// _tmf_params = [_tmf_params,"CONQUER_CODE",""] call CFUNC(hashSet);
// _tmf_params = [_tmf_params,"CONQUER_TIMEOUT",30] call CFUNC(hashSet);
// _tmf_params = [_tmf_params,"CONQUER_TAKER",[GVAR(side_own)]] call CFUNC(hashSet);

OBJ = [_obj_params,"CONQUER",_tmf_params] call FFUNC(CreateMissionObject);